#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
	int arr[10] = { 1,2,3,4,5,1,2,3,4,6 };
	int digit = 0;
	int res1 = 0, res2 = 0;
	for (int i = 0; i < 10; i++) {
		digit ^= arr[i];
	}
	digit ^= digit & (digit - 1);
	for (int i = 0; i < 10; i++) {
		if ((digit ^ arr[i] & (arr[i] - 1) ^ arr[i]) == 0) {
			res1 ^= arr[i];
		}
		else res2 ^= arr[i];
	}
	printf("%d %d", res1, res2);
	return 0;
}

//#include <stdio.h>
//int main() {
//	int year, month;
//	int arr[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
//	while (scanf("%d%d", &year, &month) != EOF) {
//		if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))
//			arr[2] = 29;
//		printf("%d\n", arr[month]);
//		arr[2] = 28;
//	}
//	return 0;
//}